<button>点击</button>

<script>

    var btn = document.querySelector('button')



    btn.onclick = debounce()


    function debounce() {
        let timer = null

        return function () {
            // fn = fn.bind(this)
            if (timer) {
                clearTimeout(timer)
            }
            timer = setTimeout(function () {
                console.log(1);
            }, 200)
        }


    }




</script>